package com.hehe.Dao;

import com.hehe.POJO.Tb_slang;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@org.apache.ibatis.annotations.Mapper
public interface Test_Mapper {



/*


SELECT * FROM `tb_slang`
WHERE id >= (SELECT floor( RAND () * (SELECT MAX(id) FROM `table`)))
ORDER BY id LIMIT 1;


SELECT * FROM `tb_slang` ORDER BY RAND() LIMIT 36


*
* */

    @Select("     SELECT * FROM `tb_slang` ORDER BY RAND() LIMIT 36      ")
    List<Tb_slang> get_All();

    @Select("   SELECT count(*) FROM `tb_slang`    ")
    Integer get_count_All();

    @Select("show databases;")
    List<String> showDatabases();

    @Update(" CREATE TABLE IF NOT EXISTS `zz_test_tb`(`title` varchar(220) )ENGINE=InnoDB DEFAULT CHARSET=utf8; ")
    Integer create_table();

    @Insert("       insert into zz_test_tb( `title`  )  values  (     #{title}     )     ")
    Integer insert__(String title );






//    @Select("   SELECT * FROM `tb_test`   where id = #{id}    ")
//    Tb_test get_by_id(Integer id);
//    @Insert("       insert into t_question( `question` , `answer` , `type` , `from` )  values  (  #{question} , #{answer} , #{type} , #{from}  )     ")
//    Integer insert__(String question, String answer, String type, String from);

    /*

    @insert：   插入n条记录，返回影响行数n。（n>=1，n为0时实际为插入失败）
    @update：   更新n条记录，返回影响行数n。（n>=0）
    @delete：   删除n条记录，返回影响行数n。（n>=0）

    */





}
